package interface_.exer;

/**
 * Created with IntelliJ IDEA.
 * ClassName: EatableTest
 * Package: interface_.exer
 * Description:
 * User: fzykd
 *
 * @Author: LQH
 * Date: 2023-11-24
 * Time: 22:02
 */

public class EatableTest {

    public static void main(String[] args) {

        //这是数组 数组的类型是这个接口类型的
        Eatable[] eatables = new Eatable[3];

        eatables[0] = new Chinese(); //多态性
        eatables[1] = new American();
        eatables[2] = new Indian();

        for (int i = 0; i < eatables.length; i++) {
            eatables[i].eat();
        }

    }

}
